package com.thon.entity.user;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.thon.entity.project.ProjectSupport;
import com.thon.entity.util.IdEntity;

/**
 * 礼品
 */
@Entity
@Table(name = "present")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Present extends IdEntity {
	
	private static final long serialVersionUID = 1L;
	private String toPhone;//收礼人手机号
	private int status;//0,未领取 1，已领取 
	private ProjectSupport support;//ProjectSupport
	
	//礼物收取是否已看
	public static final Integer STATUS_UNREAD = 0;
	public static final Integer STATUS_READ = 1;
	
	public int getStatus() {
		return status;
	}
	
	public void setStatus(int status) {
		this.status = status;
	}

	public String getToPhone() {
		return toPhone;
	}

	public void setToPhone(String toPhone) {
		this.toPhone = toPhone;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "support_id", nullable = false)
	@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
	public ProjectSupport getSupport() {
		return support;
	}

	public void setSupport(ProjectSupport support) {
		this.support = support;
	}

}
